<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>欢迎来到 Yobol 登录页面</title>
    
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/css/commons.css"/>
    <link rel="stylesheet" type="text/css" href="<%= request.getContextPath()%>/css/login.css"/>
  </head>
  
  <body>
  	<%
  		String msg = (String)request.getAttribute("msg");
  		if(msg != null)
		{
			if(msg.equals("该用户名不存在"))
			{
	%>
				<script>alert("该用户名不存在");</script>
	<%
			}else if(msg.equals("密码错误")){
	%>
				<script>alert("密码错误");</script>
	<%
			}
		}
	%>
  	<div id="main_container">
		<div id="main">
			<div id="main_top">
				<a id="logo" href="<%=request.getContextPath() %>/index.jsp" title="返回首页"></a>
			</div>
			
			<div id="main_center">
				<div id="login">
					<form action="<%=request.getContextPath()%>/LoginInServlet" method="post">
						<%
							if (request.getHeader("referer") != null) {//从别的页面跳转过来
						%>
							<input type="hidden" name="returnUrl" value="<%=request.getHeader("referer")%>" />
						<%
							}
						%>
						<div>
							<label for="uName">用户名</label>
							<input id="uName" type="text" name="uName" />
						</div>
						<div>
							<label for="uPwd">密码</label><a href="http://www.baidu.com">忘记密码</a>
							<input id="uPwd" type="password" name="uPwd" />
						</div>
						<div>
							<input type="submit" value="登录" />
						</div>
					</form>
				</div>
				<div id="third_party_login">
					<a href="www.baidu.com" title="第三方登录——QQ">QQ</a>
					<a href="www.baidu.com" title="第三方登录——微信">微信</a>
					<a href="www.baidu.com" title="第三方登录——微博">微博</a>
					<a href="www.baidu.com" title="第三方登录——百度">百度</a>
				</div>
			</div>
			
			<div id="main_bottom">
				<a href="<%=request.getContextPath() %>/pages/register.jsp">还没有账号?现在注册</a>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/jquery-3.1.1.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/jquery.validate.min.js"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/js/login.js"></script>
  </body>
</html>
